<?php

namespace App\Http\Controllers;

use Laravel\Lumen\Routing\Controller as BaseController;

class Controller extends BaseController
{
    public static function responseSuccess($data = null, $msg = null, $code = 1000){
        $response = [
            'code' => $code,
            'err'  => false,
            'msg'  => $msg,
            'data' => $data
        ];
        return response()->json($response, 200);
    }

    public static function responseError($code, $msg = null, $data = null){
        $response = [
            'code' => $code,
            'err'  => true,
            'msg'  => $msg,
            'data' => $data
        ];
        return response()->json($response, 200);
    }

}
